<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>创建构造函数Person的Student子类</title>
	</head>
	<body>
	<script type="text/javascript">
	function Person(name,chinese,math){
		this.name=name;
		this.chinese=chinese;
		this.math=math;
		this.getName=function(){
			return this.name;
		}
		this.getChinese=function(){
			return this.chinese;
		}
		this.getMath=function(){
			return this.math;
		}
	}
	function Student(age){
		this.age=age;
	}
	Student.prototype=new  Person("张三","98","80");
	Student.prototype.getAge=function(){
		return this.age;
	}
	var student1=new Student("25");
	document.write("姓名："+student1.getName()+"<br />语文："+student1.getChinese()+"<br />数学："+student1.getMath()+"<br />年龄："+student1.getAge())
	</script>
	</body>
</html>
